Skip to main content

Simulating the truck rating response

5 Tasks

30 mins

Pega Platform '23
Visible to: All users
Advanced Pega Platform '23 English

Scenario

When the vendor registers the truck, the Executive Manager will review and either approve or reject the truck. If the truck is approved, the City Manager will be assigned the task of ranking the companies that will provide truck services for that city.

To rank the companies, the City Manager will retrieve the truck rating from an external system by providing the VIN. The average rating of all trucks belonging to that company will become the initial rating of the company. It is important to note that the external truck system rating must be simulated.

Simulating the external truck system rating will involve creating a test environment that mimics the behavior of the actual external system. This can be done by creating a mock API that returns test data that simulates the behavior of the external system. The mock API can be designed to return different ratings for different companies, allowing the City Manager to test the ranking process with different scenarios.

Once the external truck system rating is simulated, the City Manager can use the retrieved ratings to rank the companies that will provide truck services for the city. The ranking process can be based on a variety of factors, such as the average rating of the company's trucks, the number of trucks the company has, and the company's reputation in the industry.

Overall, simulating the external truck system rating is an important step in ensuring that the ranking process is accurate and reliable. By creating a test environment that mimics the behavior of the actual external system, the City Manager can test the ranking process with different scenarios and ensure that the ranking is based on accurate and reliable data.

The following table provides the credentials you need to verify the solution:

Role User name Password
Admin admin@deliveryservice rules

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Identify design options

Option 1

Enable the Simulate data source option for the data page, then create a data transform to simulate the response.

Simulate-Truck-Rating
Option 2

Associate a simulation activity with the rest connector.

GTRS-Simulation
Option 3

Create a REST service and get the rating from this service.

2 Evaluate the design options

Design approach Pros Cons
Simulate data source
  • Easy to configure
  • Can be sourced as Data transform, Report definition, lookup, activity
  • Need unlocked ruleset version unless managed by a when rule that refers the logic of when to refer to a simulated data source, and a dynamic system setting set to true when it is needed to call a simulated source.
Connector simulation activity
  • Can control the applicability of the simulation activity, whether it applies to a particular requestor session (user session), or to all requestors sessions (global).
  • Need to associate with a ruleset version.
Create REST service
  • More control as needed to manage the endpoint URL (actual service or simulated service).
  • More development effort is needed to create and consume a completely new REST service like actual service.

3 Recommend the best design option

In this scenario, we use the Simulate data source approach because it is easily configurable and has multiple source options.

4 Identify required configuration tasks

  1. On the data page that invokes the connector, toggle the simulation on.
  2. To set the rating, update the source to a data transform or an activity.

5 Review Solution details

  1. Log in with admin@deliveryservice and the password rules, and switch to the MDC application.
  2. Locate the Retrieve truck rating data page under the GTRS data type.
  3. Click Toggle simulation or switch to Dev Studio and select the Simulate data source checkbox.
GTRS-DataPage
Simulate-Truck-Rating

Selecting the checkbox in Dev Studio 

  1.  To set the truck rating and other required properties, update the source to a data transform or an activity.

Confirm your work

      



Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice